package com.hp.test.java8.lambda.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class ListToMap {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("Jack");
        list.add("Tom");
        list.add("Lucy");
        list.add("Jane");
        list.add("Jack");

        Map<String, String> map = list.stream().collect(Collectors.toMap(s -> s, e -> e, (key1, key2) -> key1+"#"));

        System.out.println(map);
    }
}
